Digital clock-duty-cycle correction

ABSTRACT

A duty cycle correction circuit includes a charge pump and a controller. The charge pump includes a current source, a first output, and a second output. The charge pump routes current from the current source to the first output during a positive portion of a clock, and routes current from the current source to the second output during a negative portion of the clock. The controller compares charge accumulated from the first output to charge accumulated from the second output over a plurality of clock cycles to determine which of the positive portion of the clock and the negative portion of the clock is longer. The controller also generates a digital value that indicates an amount of adjustment to apply to a duty cycle of the clock based on which of the positive portion of the clock and the negative portion of the clock is longer.

CROSS-REFERENCE TO RELATED APPLICATIONS

This continuation application claims priority to U.S. patent applicationSer. No. 14/927,949, filed Oct. 30, 2015, which application isincorporated herein by reference.

BACKGROUND

Clock signals are commonly used in many electronics circuits and forvarious purposes. For example, dock signals are used to triggersynchronous circuits (e.g., flip-flops) in digital circuits such asprocessors, memory devices, and so on. Clock signals may be generatedwith various types of oscillators and supporting circuitry. A clocksignal continually transitions between two levels (e.g., logic high andlogic low levels). The clock signal has a duty cycle that is determinedby the time duration at logic high and the time duration at logic low.

The duty cycle of a dock signal is generally stated as a percentage. Forexample, a clock signal that has a pattern of 80% high and 20% low hasan 80% duty cycle. In some applications, it may desirable that the dutycycle of a dock signal be a 50% cycle, where a 50% duty cycle has awaveform with equal high and low portions. For example, circuits thatrely on both clock edges may not function properly if a 50% duty cycledock is not applied to the circuits. Unfortunately, many types ofcircuits create duty cycle distortion, and it can be difficult tomaintain a 50% duty cycle.

SUMMARY

An apparatus and method for controlling the duty cycle of a clock aredisclosed herein. In some embodiments, a clock generator includes a dutycycle correction circuit. The duty cycle correction circuit includes acharge pump and a controller. The charge pump includes a current source,a first output, and a second output. The charge pump is configured toroute current from the current source to the first output during apositive portion of a clock, and to route current from the currentsource to the second output during a negative portion of the clock. Thecontroller is configured to compare charge accumulated from the firstoutput to charge accumulated from the second output over a plurality ofclock cycles to determine which of the positive portion of the clock andthe negative portion of the clock is longer. The controller is alsoconfigured to generate a digital value that indicates an amount ofadjustment to apply to a duty cycle of the clock based on which of thepositive portion of the clock and the negative portion of the clock islonger.

In other embodiments, a clock duty cycle correction circuit includes acharge pump and a controller. The charge pump includes a current source,a first current output terminal, a second current output terminal, afirst clock input terminal, a second clock input terminal, a firsttransistor, a second transistor, a reset terminal, and a resettransistor. The first transistor is coupled to the current source, thefirst clock input terminal, and the first current output terminal toconnect the current source to the first output terminal based onassertion of a clock signal at the first clock input terminal. Thesecond transistor is coupled to the current source, the second clockinput terminal, and the second current output terminal to connect thecurrent source to the second output terminal based on assertion of aninverted version of the clock signal at the second clock input terminal.The reset transistor is coupled to the first current output terminal,the second current output terminal, and the reset terminal to short thefirst current output terminal to the second current output terminalbased on assertion of a signal at the reset terminal. The controller isconfigured to compare charge accumulated from the first current outputto charge accumulated from the second current output over a plurality ofcycles of the clock signal to determine which of a positive portion ofthe clock signal and a negative portion of the clock signal is longer.The controller is also configured to generate a digital value thatindicates an amount of adjustment to apply to a duty cycle of the clocksignal based on which of the positive portion of the clock signal andthe negative portion of the clock signal is longer.

In further embodiments, a method for correcting the duty cycle of aclock signal includes resetting charge storage elements to a samevoltage prior to execution of an integration stage. During theintegration stage, charge stored on a first of the charge storageelements is changed only during a high portion of each of a plurality ofcycles of the clock signal, and charge stored on a second of the chargestorage elements is changed only during a low portion of each of theplurality of cycles of the clock signal. After the integration stage,which of the high portion and low portion of the clock signal is longeris determined based on the charge stored on the charge storage elements,a digital value that controls the duty cycle of the clock signal isadjusted to reduce the length of the portion of the clock signal that islonger, and the digital value is applied to control the duty cycle ofthe clock signal.

BRIEF DESCRIPTION OF THE DRAWINGS

For a detailed description of various examples, reference will now bemade to the accompanying drawings in which:

FIG. 1 shows a block diagram for a duty cycle correction circuit inaccordance with various embodiments;

FIG. 2 shows a block diagram for a charge pump suitable for use in aduty cycle correction circuit in accordance with various embodiments;

FIG. 3 shows a schematic diagram for a charge pump suitable for use in aduty cycle correction circuit in accordance with various embodiments;

FIG. 4 shows a block diagram for a clock multiplexer that routes clocksignals to a charge pump in a duty cycle correction circuit inaccordance with various embodiments;

FIG. 5 shows a timing diagram for a clock signal provided to a chargepump in a duty cycle correction circuit in accordance with variousembodiments;

FIG. 6 shows outputs of a charge pump as a clock signal converges to a50% duty cycle in a duty cycle correction circuit in accordance withvarious embodiments;

FIG. 7 shows an input clock signal and a duty cycle corrected clocksignal produced by a duty cycle correction circuit in accordance withvarious embodiments;

FIG. 8 shows a block diagram of a duty cycle correction circuit thatincludes in-loop calibration in accordance with various embodiments;

FIG. 9 shows a block diagram of a duty cycle correction circuit thatincludes off-loop calibration in accordance with various embodiments;and

FIG. 10 shows a flow diagram for a method for duty cycle correction inaccordance with various embodiments.

DETAILED DESCRIPTION

Certain terms are used throughout the following description and claimsto refer to particular system components. As one skilled in the art willappreciate, different companies may refer to a component by differentnames. This document does not intend to distinguish between componentsthat differ in name but not function. In the following discussion and inthe claims, the terms “including” and “comprising” are used in anopen-ended fashion, and thus should be interpreted to mean “including,but not limited to . . . .” Also, the term “couple” or “couples” isintended to mean either an indirect or direct wired or wirelessconnection. Thus, if a first device couples to a second device, thatconnection may be through a direct connection or through an indirectconnection via other devices and connections. The recitation “based on”is intended to mean “based at least in part on.” Therefore, if X isbased on Y, X may be based on Y and any number of other factors.

Conventional duty-cycle correction circuits are implemented as analogloops. While such implementations may be effective for correcting theduty cycle of continuous clock signals, burst mode applications presentsignificant problems because the analog loop must settle every time aburst of clocks is generated. The requisite state of the loop forproducing a 50% duty cycle is lost when the input clock is removed,requiring a long settling period every time the input clock isre-applied. Additionally, because continuous clock generation isrequired to maintain a 50% duty cycle, the power consumption of the dutycycle correction circuit and the system applying duty cycle correctionare also increased.

Embodiments of the duty cycle correction circuit disclosed hereinprovide a reduced settling time for duty cycle correction in burst modeapplications, and may also reduce overall cost by reducing the size ofanalog filter components such as capacitors or resistors needed forcircuit implementation. In the duty cycle correction circuit of thepresent disclosure, the feedback path is implemented in the digitaldomain (instead of analog) with a digital-to-analog converter providingthe analog signal required for offset correction. At system start-up,after an input clock is provided, the duty cycle correction circuit isallowed to settle to the desired accuracy. The value provided to thedigital-to-analog converter at the end of settling is stored. If theclock is removed and then supplied again at a later time, the loop willstart from the previously stored digital-to-analog converter input valueallowing a faster settling time. Moreover, once the duty cyclecorrection circuit has settled, the bulk of the circuit, except for thedigital-to-analog converter, can be turned off, reducing powerconsumption.

FIG. 1 shows a block diagram for a duty cycle correction (DCC) circuit100 in accordance with various embodiments. The DCC circuit 100 includesa clock source 102, a programmable delay 104, a pulse generator 106, acharge pump 108, capacitors 110, comparator 112, and correction controllogic 114. The clock source 102 may be an oscillator of any of varioustypes. The duty cycle of the clock signal 124 provided by the clocksource 102 may not be 50%. The clock source 102 provides clock signal124 to the programmable delay 104 and the pulse generator 106. Theprogrammable delay 104 delays the clock signal 124 by a time that variesand is controllable by a value received from the correction controllogic 114. In some embodiments, the programmable delay 104 may include adigital-to-analog converter (DAC) 116 that converts a digital value 122received from the correction control logic 114 to an analog signal(e.g., a voltage or current). The programmable delay 104 may vary thedelay applied to the clock signal 124 as a function of the analogsignal. For example, capacitance that affects propagation of the clocksignal 124 through the programmable delay 102 may be varied as afunction of the analog signal. Some embodiments of the programmabledelay 102 may vary delay applied to the clock signal 124 based on thedigital value 122 received from the correction control logic 114 in adifferent manner. For example, the digital value 122 may be applied togenerate a delay be selecting delay elements included in theprogrammable delay 102.

The pulse generator 106 generates a corrected clock signal 118 havingthe frequency of the clock signal 124 received from the clock source102. The duty cycle of the corrected clock signal 118 is determined bythe delayed clock signal received from the programmable delay 102. Forexample, a rising edge of the corrected clock signal 118 may betriggered by a rising edge of the clock signal 124 received from theclock source 102, and a falling edge of the corrected clock signal 118may be triggered by a rising edge of the delayed clock signal receivedfrom the programmable delay 104. Thus, the duty cycle of the correctedclock signal 118 may be changed by changing the delay applied to theclock signal 124 by the programmable delay 104.

The charge pump 108, capacitors 110, and comparator 112 operate as aduty cycle detector to determine whether the duty cycle of the correctedclock signal 118 is greater than or less than 50%. The charge pump 108includes two output terminals. A capacitor 110 is coupled to each of theoutput terminals. In some embodiments, a single capacitor 110 may beused with a different plate of the single capacitor 110 connected toeach output terminal of the charge pump 108. The charge pump 108 alsoincludes switching circuitry that routes current to each of the twooutput terminals based on the level of the corrected clock signal 118.That is, the charge pump 108 routes current to one of the two outputterminals during a “high” portion of a cycle of the corrected clocksignal 118, and routes current to the other of the two output terminalsduring a “low” portion of a cycle of the corrected clock signal 118.Thus, the currents provided by the charge pump 108 to charge thecapacitor(s) 110 are proportional to the duty cycle of the correctedclock signal 118.

FIG. 2 shows a block diagram for an embodiment of the charge pump 108.The charge pump 108 includes a current source 202 and switches 204, 206,and 208. The current source 202 may be a cascoded tail current source insome embodiments. Other embodiments may include a different type ofconstant current source as the current source 202. The switches 204couple the current source 202 to the output terminals of the charge pump108, and route current from the current source 202 to the outputterminals based on the level of the corrected clock signal 118. Whenrouting current to the output terminals of the charge pump 108 one ofthe switches 204 may be driven and controlled by an uninverted versionof the corrected clock signal 118, and the other of the switches 204 maybe driven and controlled by an inverted version of the corrected clocksignal 118.

The charge pump 108 also includes a reset terminal. A reset signalasserted at the reset terminal controls the switches 206 and 208.Assertion of the reset signal causes the switches 206 and 208 to closeand force the capacitor(s) 110 to an initial condition prior tocharging/discharging the capacitor(s) 110 via the switches 204. Theswitches 204 may be opened while the reset signal is asserted. Theswitch 208 closes to short the output terminals of the charge pump 108.The switches 206 close to drive a predetermined reference voltage ontothe output terminals. For example, closing the switches 206 may connectthe output terminals of the charge pump 108 to a power supply voltage(e.g., V_(DD)). Thus, assertion of the reset signal may initialize thecapacitor(s) 110 to a predetermined voltage prior to use of the switches204 to route current to the capacitor(s) 110.

FIG. 3 shows a schematic diagram for an embodiment of the charge pump108. In the embodiment of FIG. 3, the switches 204 are implemented byN-channel field effect transistors (FETs) N1 and N2, the switches 206are implemented by P-channel FETs P1 and P2, and the switch 208 isimplemented by P-channel FET P3.

After the capacitor(s) 110 have been initialized by assertion of thereset signal, the capacitor(s) 110 are charged or discharged via theswitches 204 based on the duty cycle of the corrected clock signal 118.FIG. 5 shows a diagram of the corrected clock signal provided to thecharge pump 108. During the “reset” interval, the corrected clock signal118 applied to the charge pump 108 is forced to a predetermined levelthat opens the switches 204 while the switches 206 and 208 are closed toinitialize the capacitor(s) 110. An “integration” interval follows the“reset” interval. During the “integration” interval a number of cyclesof the corrected clock signal 118 are provided to the charge pump 108,and during each cycle of the corrected clock signal 118, the switches204 route current from the current source 202 to the capacitor(s) 110for determination of the duty cycle of the corrected clock signal.

FIG. 4 shows a block diagram for a clock multiplexer 400 that may beapplied between the pulse generator 106 and the charge pump 108 to forcethe corrected clock signal 118 received by the charge pump 108 to apredetermined level during the “reset” interval. For example, theoutputs of the clock multiplexer 400 are high while the reset signal isasserted. While the reset signal is not asserted, the clock multiplexer400 passes inverted and uninverted versions of the corrected clocksignal 118 to the charge pump 108 for control of the switches 204.

Returning to FIG. 1, the comparator 112 identifies which level of thecorrected clock signal 118 is longer by comparing the charge accumulatedon the capacitor(s) 110 during the “low” level of the corrected clocksignal 118 to the charge accumulated on the capacitor(s) 110 during the“high” level of the corrected clock signal 118. For example, if thecharge accumulated on the capacitor(s) 110 during the “low” level of thecorrected clock signal 118 is greater than the charge accumulated on thecapacitor(s) 110 during the “high” level of the corrected clock signal118, then the comparator 112 may output a first signal level. Otherwise,the comparator 112 may output a different signal level. In any case, thecomparator 112 generates a signal 120 that indicates whether the “high”level or the “low” level of the corrected clock signal 118 is longer.The output signal 120 may be latched at completion of each “integration”interval for provision to the correction control logic 114.

The correction control logic 114 receives the comparator output signal120, and adjusts the digital value 122 provided to the programmabledelay 104 to change the duty cycle of the corrected clock signal 118based on the comparator output signal 120. If the comparator outputsignal 120 indicates that the “high” portion of the corrected clocksignal 118 is longer than the “low” portion of the corrected clocksignal 118, then the correction control logic 114 may adjust the digitalvalue 122 to change the delay applied in the programmable delay 104 suchthat the duration of the “high” portion of the corrected clock signal118 is decreased and the duration of the “low” portion of the correctedclock signal 118 is increased. Similarly, if the comparator outputsignal 120 indicates that the “low” portion of the corrected clocksignal 118 is longer than the “high” portion of the corrected clocksignal 118, then the correction control logic 114 may adjust the digitalvalue 122 to change the delay applied in the programmable delay 104 suchthat the duration of the “low” portion of the corrected clock signal 118is decreased and the duration of the “high” portion of the correctedclock signal 118 is increased.

The correction control logic 114 may apply various adjustment methods tochange the duty cycle of the corrected clock signal 118. For example, inone embodiment, the correction control logic 114 may increment ordecrement the digital value 122 once per integration interval based onthe comparator output signal 112 to move the corrected clock signaltowards 50% duty cycle. In other embodiments, the correction controllogic 114 may apply a successive approximation technique to more rapidlyadjust the digital value 122 for achieve a 50% duty cycle.

FIG. 6 shows the outputs of the charge pump 108 as the correctioncontrol logic 114 causes the corrected clock signal 118 to converge to a50% duty cycle using a successive approximation technique to adjust thedigital value 122. Initially, there is a large difference between thecharge pump outputs. The difference is reduced as the duty cycle of thecorrected clock signal 118 approaches 50%. Finally, once the loop hassettled, the charge pump outputs change sign every integration intervalas shown after about 20 ns. At the end of one interval, a given outputis positive, and at the end of the successive integration interval, thegiven output is negative. Accordingly, the comparator output signal 120flips between one and zero with each integration interval when thecorrected clock signal 118 has converged to a 50% duty cycle.

The correction control logic 114 may also generate various controlsignals for the DCC circuit 100. For example, the correction controllogic 114 may generate the reset signal, based on the corrected clocksignal 118, to control timing of the reset and integration intervals inthe charge pump 108, a latch control signal for latching the output ofthe comparator 112, and other control signals.

FIG. 7 shows the clock signal 124 provided by the clock source 102 andthe corrected clock signal 118. The clock signal 124 has about a 65%duty cycle. The duty cycle of the corrected clock signal 118 has beenadjusted to 50% by the DCC circuit 100. That is, the DCC circuit 100 hasadjusted the durations of the high (or positive) portion 704 and the low(or negative) portion 702 of the clock signal 118 such that the durationof the high (or positive) portion 704 of the clock signal 118 isapproximately the same as the duration of the low (or negative) portion702 of the clock signal 118.

For high accuracy clock correction, the DCC circuit 100 should detectthe smallest possible clock cycle correctly. For example, if an accuracyof 1% is desired, the DCC circuit 100 has to be able to differentiatebetween a 49% duty cycle clock and a 51% duty cycle clock (i.e., thecharge pump 108 has to generate a negative output for a 49% duty-cycleinput and the comparator 112 has to be able to resolve that input asnegative, and vice-versa for the 51%). With limited headroom in scaledCMOS technologies, the output of a nominal charge pump for the smallestoutputs is small. With mismatch effects, the small output might changesign leading to a wrong decision. Accordingly, embodiments of the DCCcircuit 100 may include offset calibration or offset cancellation.

FIG. 8 shows a block diagram of a DCC circuit 800 that includes in-loopcalibration in accordance with various embodiments. The DCC circuit 800is similar to the DCC circuit 100, but includes additional calibrationlogic 804, a calibration DAC 806, and a calibration multiplexer 802. Thecorrection control logic 114 may also include inversion circuitry tofacilitate calibration. The calibration logic 804 generates a flipcontrol signal 808 that controls the calibration multiplexer 802 andinversion circuitry in the correction control logic 114. Assertion ofthe flip control signal 808 causes the calibration multiplexer 802 toinvert the corrected clock signal 118 provided to the charge pump 108and to activate the inversion circuitry in the correction control logic114 to invert the output of the comparator 112. The calibration logic804 may adjust one or more components of the DCC circuit 800 tocompensate for offset measured by the calibration. For example, the DAC806 calibrates the DCC circuit 800 by changing the load to thecomparator 112 as shown, or by changing the load to the charge pump 108.In some embodiments, the calibration logic 804 may compensate formeasured offset by altering the values of the capacitors 110, creatingan imbalance in the currents output by charge pump 108, apply an offsetvoltage at the input of the comparator 112, applying a current offset inthe load of the comparator 112, selectable changing the size of a devicein an input stage of the comparator 112, selectable changing the size ofa device in an output stage of the charge pump 108, or making otheroffset compensation adjustments to the DCC circuit 800. Calibrationusing the DCC circuit 800 is advantageous in that calibration does notrequire a 50% duty cycle clock, however the duty cycle of the correctedclock signal 118 changes during the calibration process. Therefore thistechnique is only appropriate during an initial calibration period orduring a period in normal operation where a duty cycle deviation from50% is acceptable.

Assume the offset of the charge pump 108 and comparator 112 combinationcauses the output duty cycle of the corrected clock signal 118 to be50%+Δ×%. With the flip signal 808 not asserted, this means that thesignal directly at the input to the charge pump 108 will have aduty-cycle of 50%+Δ×%. Assume the corresponding digital value 122 at theinput of the DAC 116 to be DAC_noflip. Now, let the flip signal 808 beasserted to invert the clocks 118 input to the charge pump 108 andactivate inversion of the comparator output 102 in the correctioncontrol logic 114. Again, due to the offset of the charge pump 108 andcomparator 112, the loop settles when the input to the charge pump is ata duty-cycle of 50%+Δ×%. This, in turn, means that the duty cycle of thecorrected clock signal 118 is (100%−(50%+Δ×%)) i.e. 50%−Δ×%. Let thecorresponding digital value 122 applied to the DAC 116 be DAC_flip.Given this information, two approaches are possible for offsetcorrection.

In a first approach, the calibration DAC 806 is used to counteract theoffset of the charge pump 108 and comparator 112. In this case, theabove procedure is repeated for each code of the calibration DAC 806until DAC_flip=DAC_noflip. This requires 2^(N) calibration cycles for acalibration DAC 806 of N-bits. In some embodiments, a binary-search(successive approximation) approach is used to achieve the same targetin N calibration cycles.

In a second approach, the DCC correction loop is opened, disconnectingthe charge pump 108, the comparator 112, and the correction controllogic 114, and a digital value 122 equal to the average ofDAC_noflip+DAC_flip is applied to the DAC 116. This approach requiresthat the DAC 116 be linear within a desired accuracy.

FIG. 9 shows a block diagram of a DCC circuit 900 that includes off-loopcalibration in accordance with various embodiments. The DCC circuit 900allows the duty cycle of the corrected clock 118 to remain constantwhile calibration to be performed. As a result, the DCC circuit 900 canbe periodically calibrated without disrupting normal clock generation.The DCC circuit 900 is similar to the DCC circuit 100, but includesadditional calibration logic 906, a calibration DAC 908, a calibrationmultiplexer 902, and a calibration clock source 904. The calibrationclock source 904 provides a calibration clock 912 having a 50% dutycycle for use in calibrating the DCC circuit 900. The calibration clocksource 904 may generate the calibration clock 912 by dividing the clocksignal 124 by two or by any other method of generating a 50% duty cycleclock signal. The calibration multiplexer 902 selectively routes thecalibration clock 912 or the corrected clock signal 118 to the chargepump 108.

During calibration, the correction control logic 114 generates the resetsignal based on the calibration clock 912. If the calibration clock 912is generated by dividing the clock signal 124 by two, then the number ofclock cycles applied to the reset interval and the integration intervalmay also be divided by two to maintain the same integration time as usedwith the corrected clock signal 118. The switch 910 may be opened toisolate the correction logic 114, the programmable delay 104, and thepulse generator 106 from the circuitry being calibrated. The state ofthe correction logic 114, the programmable delay 104, and the pulsegenerator 106 may be unaffected by the calibration process. That is, thedigital value 122 provided to the programmable delay 122 may be constantduring calibration, thereby maintaining the duty cycle of the correctedclock signal 118 during calibration. The calibration logic 906 changes(e.g., changes incrementally) the value applied to the calibration DAC908 until the output of the comparator changes (e.g., changes from highto low, or from low to high). The value applied to the calibration DAC908 to cause the change in comparator output is the calibration value.

Some embodiments of the calibration logic 906 may apply a successiveapproximation technique to identify the calibration value. For example,assuming that a minimum value applied to the calibration DAC 908 causesa negative offset and negative comparator output, and vice-versa, asuccessive approximation search for the calibration value may proceed asfollows:

-   -   1) The most significant bit (MSB) of the value applied to the        calibration DAC 908 is set to 1 and all other of the bits of the        value are set to zero.    -   2) The output of the comparator 112 is checked. If the output is        positive, then the MSB of the value applied to the calibration        DAC 908 is set to 0 and the value of the next most significant        bit is set to 1. If the output is negative, then the value of        the MSB is set to 1 and the value of the next most significant        bit is also set to 1.    -   3) Calibration proceeds in this fashion until all bits are set.        The resulting code is the desired DAC calibration code.

FIG. 10 shows a flow diagram for a method 1000 for duty cycle correctionin accordance with various embodiments. Though depicted sequentially asa matter of convenience, at least some of the actions shown can beperformed in a different order and/or performed in parallel.Additionally, some embodiments may perform only some of the actionsshown. In some embodiments, at least some of the operations of themethod 600, as well as other operations described herein, can beimplemented in the DCC circuit 100.

In block 1002, the voltages on charge storage elements (capacitors 110)used to measure duty cycle are reset to a common predetermined voltage.In the DCC circuit 100, the resetting is implemented by closing switches206 and 208 in the charge pump 108 responsive to assertion of a resetsignal received by the charge pump 108.

In block 1004, the capacitors 110 have reset during a reset interval inpreparation for accumulation of charge on the capacitors during anintegration interval. During the integration interval, multiple cyclesof a clock are received by the charge pump 108. During a high portion ofeach clock cycle received by the charge pump 108, the charge pump 108routes current from a constant current source 202 to a first of thecapacitors 110 to change the charge stored on the capacitor inproportion to the duration of the high portion of the clock signal.

In block 1006, during a low portion of each clock cycle received by thecharge pump 108, the charge pump 108 routes current from the constantcurrent source 202 to a second of the capacitors 110 to change thecharge stored on the capacitor in proportion to the duration of the lowportion of the clock signal.

In block 1008, the voltages on the capacitors 110 are compared (e.g., bythe comparator 112).

In block 1010, a digital value is adjusted based on which of thevoltages is greater. For example, if the voltage stored on the first ofthe capacitors 110 is greater than the voltage stored on the second ofthe capacitors 110, then the digital value may be increased. Similarly,if the voltage stored on the first of the capacitors 110 is less thanthe voltage stored on the second of the capacitors 110, then the digitalvalue may be decreased. In the DCC circuit 100, the correction controllogic 114 may adjust the digital value based on the output of thecomparator 112.

In block 1012, the digital value is converted to an analog signal (e.g.,converted to a voltage in the DAC 116). In some embodiments, the digitalvalue may be directly applied to select an amount of delay, rather thanconverted to an analog signal.

In block 1014, the analog signal is applied to set a time delay, and thetime delay is applied to delay a clock signal. In the DCC circuit 100,the programmable delay 104 applies the analog signal to delay the clocksignal 124. In embodiments, that apply the digital value directly, theprogrammable delay 104 applies a delay selected based on the digitalvalue to delay the clock signal 124.

In block 1016, the delayed clock signal is used to set the duty cycle ofan output clock signal (e.g., the corrected clock signal 118).

These operations may be repeated any number of times to reduce the timedifference between the high portion and low portion of the output clocksignal. In addition to the operations discussed above, calibrationoperations as disclosed herein may be performed to reduce the effects ofoffset in the DCC circuit 100 on output clock duty cycle.

The above discussion is meant to be illustrative of the principles andvarious embodiments of the present invention. Numerous variations andmodifications will become apparent to those skilled in the art once theabove disclosure is fully appreciated. It is intended that the followingclaims be interpreted to embrace all such variations and modifications.

What is claimed is:
 1. A clock generator, comprising: a duty cyclecorrection circuit, comprising: a charge pump comprising: a currentsource; a first output; a second output; a first switch; and a secondswitch; wherein the charge pump is configured to: route current from thecurrent source through the first switch to the first output during apositive portion of a clock; and route current from the current sourcethrough the second switch to the second output during a negative portionof the clock; and a controller configured to: compare charge accumulatedfrom the first output to charge accumulated from the second output overa plurality of clock cycles to determine which of the positive portionof the clock and the negative portion of the clock is longer; generate adigital value that indicates an amount of adjustment to apply to a dutycycle of the clock based on which of the positive portion of the clockand the negative portion of the clock is longer.
 2. The clock generatorof claim 1, wherein the controller is configured to adjust the digitalvalue to reduce the length of the one of the positive portion of theclock and the negative portion of the clock that is longer.
 3. The clockgenerator of claim 1, further comprising one or more capacitors coupledto the current source to accumulate charge provided by the first outputand the second output.
 4. The clock generator of claim 1, furthercomprising: a digital-to-analog converter coupled to the controller; anda pulse width adjuster coupled to the digital-to-analog converter;wherein the digital-to-analog converter is configured to convert thedigital value to an analog signal, and the pulse width adjuster isconfigured to set the duty cycle of the clock based on the analogsignal.
 5. The clock generator of claim 1, wherein the controller isconfigured to reset the charge accumulated from the first output and thecharge accumulated from the second output by setting the first outputand the second output to a same voltage prior to an initial one of theplurality of clock cycles.
 6. The clock generator of claim 1, furthercomprising calibration circuitry comprising: a clock circuit configuredto produce a calibration clock having a 50% duty cycle; a multiplexer toroute the calibration clock to the charge pump; a digital-to-analogconverter coupled to one of the charge pump and a comparator thatcompares the charge accumulated from the first output to chargeaccumulated from the second output over a plurality of clock cycles; anda calibration controller that identifies offset in the clock generatoras a value applied to the digital-to-analog converter to change a valueof output of the comparator while the calibration clock is applied tothe charge pump.
 7. A clock duty cycle correction circuit comprising: acharge pump comprising: a current source; a first current outputterminal; a second current output terminal; a first clock inputterminal; a second clock input terminal; and a first transistor coupledto the current source, the first clock input terminal, and the firstcurrent output terminal to connect the current source to the firstoutput terminal based on assertion of a clock signal at the first clockinput terminal; a second transistor coupled to the current source, thesecond clock input terminal, and the second current output terminal toconnect the current source to the second output terminal based onassertion of an inverted version of the clock signal at the second clockinput terminal; a reset terminal; and a reset transistor coupled to thefirst current output terminal, the second current output terminal, andthe reset terminal to short the first current output terminal to thesecond current output terminal based on assertion of a reset signal atthe reset terminal; and a controller configured to: compare chargeaccumulated from the first current output to charge accumulated from thesecond current output over a plurality of cycles of the clock signal todetermine which of a positive portion of the clock signal and a negativeportion of the clock signal is longer; and generate a digital value thatindicates an amount of adjustment to apply to a duty cycle of the clocksignal based on which of the positive portion of the clock signal andthe negative portion of the clock signal is longer.
 8. The clock dutycycle correction circuit of claim 7, further comprising one or morecapacitors coupled to the charge pump to accumulate charge provided bythe first current output and the second current output.
 9. The clockduty cycle correction circuit of claim 7, further comprising: adigital-to-analog converter coupled to the controller; and a pulse widthadjuster coupled to the digital-to-analog converter; wherein thedigital-to-analog converter is configured to convert the digital valueto an analog signal, and the pulse width adjuster is configured to setthe duty cycle of the clock based on the analog signal.
 10. The clockduty cycle correction circuit of claim 7, wherein the controller isconfigured to zero the charge accumulated from the first current outputand the charge accumulated from the second current output by assertingthe reset signal at the reset terminal prior to an initial one of theplurality of clock cycles.
 11. The clock duty cycle correction circuitof claim 7, further comprising: calibration circuitry comprising: aclock circuit configured to produce a calibration clock having a 50%duty cycle; a multiplexer to route the calibration clock to the chargepump; a digital-to-analog converter coupled to one of the charge pumpand a comparator that compares the charge accumulated from the firstoutput to charge accumulated from the second output over a plurality ofclock cycles; a calibration controller that identifies offset in theclock generator as a value applied to the digital-to-analog converter tochange a value of output of the comparator while the calibration clockis applied to the charge pump.